package com.anysoft.ui.presenter;

import com.anysoft.api.ApiFactory;
import com.anysoft.base.BasePresenter;
import com.anysoft.callback.rxjavahelper.RxObserver;
import com.anysoft.callback.rxjavahelper.RxResultHelper;
import com.anysoft.callback.rxjavahelper.RxSchedulersHelper;
import com.anysoft.model.ResponseData;
import com.anysoft.ui.view.LoginView;

/**
 * Created by LiTingYao on 2018/5/25.
 */
public class LoginPresenter extends BasePresenter<LoginView>{
    
    public void getLoginData(String mobile, String password) {
        ApiFactory.getLoginData(mobile, password)
                .compose(RxSchedulersHelper.<ResponseData<String>>io_main())
                .compose(RxResultHelper.<String>handleResult())
                .subscribe(new RxObserver<String>() {
                    @Override
                    public void _onNext(String s) {
                    
                    }
    
                    @Override
                    public void _onError(String errorMessage) {
        
                    }
                });
    }
}
